<?php
/*
 *      tovarlistform.php
 *      
 *      Copyright 2011 Vitaliy Rakitin <virak@ukr.net>
 *      
 *      This program is free software; you can redistribute it and/or modify
 *      it under the terms of the GNU General Public License as published by
 *      the Free Software Foundation; either version 2 of the License, or
 *      (at your option) any later version.
 *      
 *      This program is distributed in the hope that it will be useful,
 *      but WITHOUT ANY WARRANTY; without even the implied warranty of
 *      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *      GNU General Public License for more details.
 *      
 *      You should have received a copy of the GNU General Public License
 *      along with this program; if not, write to the Free Software
 *      Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
 *      MA 02110-1301, USA.
 */
 
require_once("osform.php");
//require_once("tovar.php");
require_once("dictionary.php");
require_once("fieldedit.php");

class dictionarylistform extends osform {
	
	protected $object;
	protected $fieldedit;
	protected $listedit;
	
	function __construct($object) {

		parent::__construct();
		if (!(($object) && ($object instanceof dictionary))) {return false;}
		$this->object = $object;
		
		////////////////////////////////////////////////////////
		// this is a auto fill form all fields and tabulars
		$this->body = "<table>";
		foreach($this->object->getallfields() as $field) {
			$this->fieldedit = new fieldedit();
			$this->fieldedit->field = $field;
			$this->body .= "<tr><td>".$field->name."</td><td>".$this->fieldedit->get()."</td></tr>";
		}
		$this->body .= "</table>";
/*
		foreach($this->object->getalltabulars() as $tabular) {
			$this->listedit = new listedit();
			$this->listedit->object = $tabular;
			$this->body .= $this->listedit->get();
		}
*/
		////////////////////////////////////////////////////////
	}

?>

